package com.sikaryofficial.qrcode.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sikaryofficial.qrcode.domain.entity.DownloadTask;
import com.sikaryofficial.qrcode.mapper.DownloadTaskMapper;
import com.sikaryofficial.qrcode.service.IDownloadTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 下载任务Service业务层处理
 *
 * @author qinjinyuan
 * @date 2024-01-12
 */
@Service
public class DownloadTaskServiceImpl extends ServiceImpl<DownloadTaskMapper, DownloadTask> implements IDownloadTaskService {
    @Autowired
    private DownloadTaskMapper downloadTaskMapper;

    /**
     * 获取某天某业务最新任务的状态
     *
     * @param objectIds 业务ID
     * @param startTime 开始时间
     * @param endTime   结束时间
     * @return
     */
    @Override
    public List<DownloadTask> getLatestTaskStatus(List<Long> objectIds, Date startTime, Date endTime) {
        return downloadTaskMapper.getLatestTaskStatus(objectIds, startTime, endTime);
    }
}
